import Cookies from "js-cookie"

const mutations = {
  showLeftMenu(state, status) {
    state.showLeftMenu = status
  },
  showLoading(state, status) {
    state.globalLoading = status
  },
  setMenus(state, menus) {
    state.menus = menus
    },
  
  /* 保存用户权限 */
  setRules(state, rules) {
    state.rules = rules
    },
  
  setUsers(state, users) {
    state.users = users
  },
  setUserGroups(state, userGroups) {
    state.userGroups = userGroups
  },
  setOrganizes(state, organizes) {
    state.organizes = organizes
    },
  
  /* 存储人员权限 */  
    setRoles(state, roles) {
        Cookies.set('roles',roles)
        state.roles = roles
    },
  
  /* 设置登录人员id */  
    setUserId(state, userId) {
        state.userId = userId
    },

    /* 设置登录token */  
    setToken(state, token) {
        state.token = token
    },
    
    /* 设置登录人员用户名 */  
    setUserName(state, userName) {
        state.userName = userName
    },
    
    /* 设置登录人员工号 */  
    setUserStaffNum(state, staffNum) {
        state.staffNum = staffNum
    },
    
    /* 设置登录人员id */  
    setLoginUserId(state, loginUserId) {
        state.loginUserId = loginUserId
    },
    
    /* 设置履历基本信息是否全部填写完毕 */  
    setFinishedReMsg(state, isFinishedReMsg) {
        Cookies.set('isFinishedReMsg',isFinishedReMsg)
        state.isFinishedReMsg = isFinishedReMsg
    },
    
    /* 设置履历基本信息是否全部填写完毕 */  
    setPhotoPath(state, photoPath) {
        Cookies.set('photoPath',photoPath)
        state.photoPath = photoPath
    },
    
    /* 存储普通用户 / 管理员判别标识 */  
    setIsAdmin(state, isAdmin) {
        Cookies.set('isAdmin',isAdmin)
        state.isAdmin = isAdmin
    },
}
    

export default mutations
